import axios from 'axios'

// 封装获取列表的请求
export const tasklist = params => axios.get('http://localhost:3001/data', { params })

// 封装新增任务的请求
export const addtask = data => axios.post('http://localhost:3001/data', data)

// 封装获取详情接口
export const taskid = id => axios.get(`http://localhost:3001/data/${id}`)

// 封装修改任务的接口
export const checkTaskid = data => axios.put(`http://localhost:3001/data/${data.id}`, data)

// 封装删除任务的接口
export const delTaskid = id => axios.delete(`http://localhost:3001/data/${id}`)

// 封装关键词搜索任务的请求
export const nameTask = name => axios.get(`http://localhost:3001/data/?name=${name}`)
